package com.artPreter.controller;



import com.artPreter.pojo.DepartSectionTemp;
import com.artPreter.pojo.Result;
import com.artPreter.pojo.TemplateDetail;
import com.artPreter.service.IDepartSectionTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 机构栏目表 前端控制器
 * </p>
 *
 * @author jarvis
 * @since 2024-11-19
 */
@RestController
@RequestMapping("/departSectionTemp")
public class DepartSectionTempController {


    @Autowired
    private IDepartSectionTempService departSectionTempService;

    /**
     * 添加机构栏目
     * @param
     * @return
     */
    @PostMapping("/add")
    public Result add(@RequestBody DepartSectionTemp departSectionTemp) {
        departSectionTempService.add(departSectionTemp);
        return Result.success();
    }

    /**
     * 删除机构栏目
     * @param
     * @return
     */
    @PostMapping("/delete")
    public Result delete(@RequestBody DepartSectionTemp departSectionTemp) {
        departSectionTempService.delete(departSectionTemp);
        return Result.success();
    }

    /**
     * 批量机构保存栏目
     * @param departSectionTempList
     * @return
     */
    @PostMapping("/saveBatch")
    public Result saveBatchData(@RequestBody List<DepartSectionTemp> departSectionTempList) {
        departSectionTempService.saveBatchData(departSectionTempList);
        return Result.success();
    }

    /**
     * 获取机构栏目列表
     * @param departSectionTemp
     * @return
     */
    @PostMapping("/getList")
    public Result getList(@RequestBody DepartSectionTemp departSectionTemp) {
        List<DepartSectionTemp> list = departSectionTempService.getList(departSectionTemp);
        return Result.success(list);
    }


}
